import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/material.dart' hide Action;
import 'package:wowhy/service_locator.dart';
import 'package:wowhy/services/navigate_service.dart';
import 'action.dart';
import 'state.dart';

Effect<SearchState> buildEffect() {
  return combineEffects(<Object, Effect<SearchState>>{
    SearchAction.query: _query,
  });
}

void _query(Action action, Context<SearchState> ctx) {
  getIt<NavigateService>().pop(ctx.state.queryController.text);
}
